/**
 * 
 */
package edu.pku.sei.modeler.figures;

import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.Shape;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Display;

/**
 * @author YanYan
 *
 */
class CircleAndCross extends Shape{
	public static final org.eclipse.swt.graphics.Color ACTOR_COLOR = new Color(Display.getDefault(),
			200,186,62);
	@Override
	protected void fillShape(Graphics graphics) {
		graphics.pushState();
		graphics.setAntialias(SWT.ON);
		Rectangle circleArea = getBounds();
		
		int r = (int)(0.5 * circleArea.width);
		
		Point leftUp = new Point((int)(circleArea.x+0.2929*r)+1, (int)(circleArea.y+0.2929*r)+1);
		Point rightDown = new Point((int)(circleArea.x+1.7071*r)-1, (int)(circleArea.y+1.7071*r));
		Point leftDown = new Point((int)(circleArea.x+0.2929*r)+1, (int)(circleArea.y+1.7071*r));
		Point rightUp = new Point((int)(circleArea.x+1.7071*r)-1, (int)(circleArea.y+0.2929*r));
		
		graphics.drawLine(leftUp, rightDown);
		graphics.drawLine(leftDown, rightUp);
		graphics.drawOval(circleArea.x, circleArea.y, 2*r-1, 2*r-1);
		
		graphics.popState();
	}

	@Override
	protected void outlineShape(Graphics arg0) {
		// TODO Auto-generated method stub
		
	}
	
}